from module_info import *
from module_simple_triggers import *

from process_common import *
from process_operations import *

def save_simple_triggers(variable_list,triggers):
  file = open(export_dir + "simple_triggers.txt","w")
  file.write("simple_triggers_file version 1\n")
  file.write("%d\n"%len(simple_triggers))
  for simple_trigger in simple_triggers:
    file.write("%f "%(simple_trigger[0]))
    save_statement_block(file,simple_trigger[1]  , variable_list)
    file.write("\n")
  file.close()


print "exporting simple triggers..."
variables = load_variables(export_dir)
save_simple_triggers(variables,simple_triggers)
save_variables(export_dir,variables)
#print "finished."
